package runner;

public class PlayingDecision {
	
	public int playningGammerDecision(String gammerDecision){
		
		if(decisionLenghtValidate(gammerDecision) == true){
			int number = Integer.parseInt(gammerDecision);
			if(deecsionIsCorrect(number) == true){
				return number;	
			}
			else {
				System.out.println("Please enter the correct value!");
				System.exit(0);
				return 0;
			}
		}
		
		else {
			System.out.println("Please enter the correct value!");
			System.exit(0);
			return 0;
		}
	}
	
	private boolean deecsionIsCorrect(int number) {
		if((number == 1) || (number == 2)){
			return true;
		}
		else {
			return false;
		}
	}

	private boolean decisionLenghtValidate(String gammerDecision) {
		
		if(gammerDecision.length() == 1) {
			int gammerDecide = Integer.parseInt(gammerDecision);
			if(gammerDecide == 1 || gammerDecide == 9){
				return true;	
			}

			else {

				return false;
			}
		}
		
		else {
			return false;
		}
	}

}
